<%--
    Document   : loanRequest
    Created on : 04 14, 11, 15:27:20 PM
    Author     : MonicaSandoval
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="s" uri="/struts-tags" %>
<%@taglib  prefix="sj" uri="/struts-jquery-tags" %>
<%@taglib  prefix="sjg" uri="/struts-jquery-grid-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


<div id="editrequest" style="width: 100%">
    <s:url id="remoteurl" action="getdisapproved" />
    <s:url id="loanappurl" value="loanprofile-loanapp.jsp" />
    <script type="text/javascript" src="<s:url value='/struts/js/base/jquery.ui.datepicker.min.js'/>"></script>
        <script type="text/javascript">               
            function formatLink(cellvalue, options, rowObject) {
                return "<a href='<s:property value="loanappurl" />?id="+rowObject["loanverificationid"]+"' onClick='javascript: return openDialog(this)'>" + cellvalue + "</a>";
            }
            function openDialog(e) {
                window.open(e.href, "newWindow");
                return false;
            }          
            $.subscribe('showcolumns', function(event,data) {
                $("#gridtable").jqGrid('setColumns',{});
            });
        </script>
        <div style="text-align:center">
            <p>
        <sj:a
            name="showhide"
            id="showhide"
            button="true"
            buttonIcon="ui-icon-wrench"
            cssStyle="font-size:12px"
            onClickTopics="showcolumns"
        >
           Show/Hide Columns
        </sj:a>
            </p>
        </div>
    <sjg:grid
        id="gridtable"
        caption="Disapproved Loan Applications"
        dataType="json"
        href="%{remoteurl}"
        pager="true"
        navigator="false"
        autowidth="true"
        gridModel="gridModel"
        rowList="10,15,20"
        rowNum="15"
        rownumbers="false"
        shrinkToFit="false"
        groupField="['branchname']"
    	groupColumnShow="[false]"
    	groupCollapse="true"
    	groupText="['<b>{0} - {1} Loan Application(s)</b>']"
        
    >
        <sjg:gridColumn name="loanverificationid"
                        index="loanverificationid"
                        title="Loan Verification No."
                        key="true"
                        hidedlg="true"
                        hidden="true"
        />
        <sjg:gridColumn name="branchname"
                        index="branchname"
                        title="Branch Name"
                        hidedlg="true"
                        hidden="true"
        />
        <sjg:gridColumn name="documentno" 
                        index="docno"
                        title="Document No."
                        formatter = "formatLink"
                        search="true"
                        align="center"
                        cssClass="gridlink"
                        sortable="true"
        />
        <sjg:gridColumn name="borrowername"
                        index="borrowername"
                        title="Borrower Name"
                        align="center"
                        sortable="true"
        />
        <sjg:gridColumn name="amountrequested"
                        index="amountrequested"
                        title="Promissory Note"
                        formatter="currency"
                        align="right"
        />
        <sjg:gridColumn name="areaname" 
                        index="area"
                        title="Area"
                        align="center"
        />
</sjg:grid>    
</div>
